package com.ocom.payhandle.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.ocom.common.entity.card.EntityXfRecord;
import com.ocom.common.entity.card.EntityXfRecordProcess;
import com.ocom.common.request.payhandle.GetRecentOrderRecordsRequest;
import com.ocom.common.request.payhandle.QrCodeBillListRequest;
import com.ocom.common.request.payhandle.QrCodeMachDailySummaryRequest;
import com.ocom.common.request.ugcapi.order.RecentAddressRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.pay.ABCChargeConfirmVo;
import com.ocom.common.vo.pay.CallBackVo;
import com.ocom.common.vo.pyhandle.ShoppingCartRecordVo;

import java.util.Date;
import java.util.List;

public interface XfRecordProcessService extends IService<EntityXfRecordProcess> {
    int insertEntityXfRecord(Long companyID, EntityXfRecordProcess entityXfRecord);

    int updateEntityXfRecord(Long companyID, EntityXfRecordProcess updateXfRecordProcess);

    EntityXfRecordProcess selectTradeNo(Long companyID, String tradeNo, String machNo);
    EntityXfRecordProcess selectTradeNo(Long companyId, Long id);

    PageInfo<EntityXfRecordProcess> selectPageInfo(Long companyID, QrCodeBillListRequest request,Long pId);

    List<EntityXfRecordProcess> selectMachDailySummary(Long companyID, QrCodeMachDailySummaryRequest request);
    List<EntityXfRecordProcess> selectMachDailySummary2(Long companyID, QrCodeMachDailySummaryRequest request);

    EntityXfRecordProcess getRecordByOrderno(Long companyId, Long pId, String orderNo);

    boolean sendByOrderno(Long companyId, String orderNo);

    List<EntityXfRecordProcess> getNotsendRecord(Long companyId, String prefix, List<Integer> consStates, List<Integer> payState, int size);


    Result callback(Long companyId  , CallBackVo callBackVo);

    PageInfo<EntityXfRecordProcess> selectPayment(Long comId, Integer consState,Long minId,Integer page ,Integer size);
    List<EntityXfRecordProcess> selectPayment(Long comId, Integer consState, Long opTypeDiff, String deviceNo);

    Result<EntityXfRecordProcess> abcChargeConfirm(Long comId, ABCChargeConfirmVo VO);

    Result abcChargeFail(Long comId, String orderNo);

    List<EntityXfRecordProcess> getRecentOrderRecords(Long comId, GetRecentOrderRecordsRequest request);

    PageInfo<EntityXfRecordProcess> getRecentAddress(Long comId, RecentAddressRequest request);


    boolean verificationEntityXfRecord(Long companyId, String orderNo);

    //退款用更新事务
    boolean updateOrgEntityXfRecord(Long companyId, Long id);
    boolean updateOrgEntityXfRecordB(Long companyId, Long id);

    //离线记录上传 事务 & 优惠券 & 子账户
    boolean saveLxOrder(Long companyId,EntityXfRecordProcess entityXfRecordProcess,
                        Integer subAccount,
                        Integer accountId);

    //离线记录上传 事务 & 优惠券 & 子账户
    boolean saveLxOrder2(Long companyId,EntityXfRecordProcess entityXfRecordProcess,
                        Integer subAccount,
                        Integer accountId);


    Result  getWaitPayLimit(Long companyId,EntityXfRecord entityXfRecord);

    List<EntityXfRecordProcess> getWaitPayList(Long companyId, String deviceNo, String origOrderNo) ;

    boolean updateDkRecord(Long companyId,String origOrderNo);

    List<EntityXfRecordProcess> selectByOrderNos(Long companyId, List<String> orderNos);

    boolean updateXfFace(Long companyId,EntityXfRecord entityXfRecord);


    List<EntityXfRecordProcess> getMqFailList(Long companyId,List<Integer> ids) ;

    List<EntityXfRecordProcess> getRefundOrders(Long companyId) ;

    public void refundHandle(Long companyId,String deviceNo, String origOrderNO, String refundOrderNO, Date refundDate);

    List<EntityXfRecordProcess> getDelayPayList(Long companyId,Integer payState,Integer consState) ;

    List<EntityXfRecordProcess> cacelDealyPayList(Long companyId) ;

    boolean cacelDealyPay(Long companyId,Long id);



    boolean saveShoppingCard(Long companyId, List<ShoppingCartRecordVo> recordVoList);

    boolean updateShoppingCard(Long companyId, List<ShoppingCartRecordVo> recordVoList);

    public boolean saveLxOrder3(Long companyId,EntityXfRecordProcess entityXfRecordProcess, Integer subAccount, Integer accountId) ;


    List<EntityXfRecordProcess> cartOrders(Long companyId,String platOrderNo) ;


    public boolean updateOrderPayState(Long companyId, String platOrderNo);
  
	Result xfUserparam( Long companyId,EntityXfRecord entityXfRecord);

    Result xfUserparamDiscount(Long companyId,EntityXfRecord entityXfRecord);

    EntityXfRecordProcess getReadyOrderVer(Long companyId,Long pointId, Long pId, String mealDate, Integer mealNo,String orderNo);

    //sql迁移订单
    List<EntityXfRecordProcess> timerTransportOrder(Long companyId,String month,Integer part);

    List<EntityXfRecordProcess> timerTransportGoodList(Long companyId,String month,Integer part);

}
